<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>定时任务错误详情页面</title>
    <!-- jquery -->
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <link rel="stylesheet" type="text/css" th:href="@{/css/animate.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/font-awesome.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/mediaelementplayer.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/red.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/simple-line-icons.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
</head>
<body>
<div class="col-md-12 top-20 padding-0">
    <div class="col-md-12">
        <div class="panel">
            <div class="panel-body">
                <div class="col-md-12 padding-0" style="padding-bottom:20px;">
                    <h2>定时任务错误详情</h2>
                    <hr/>
                </div>
                <div class="responsive-table">
                    <table class="table table-striped table-bordered" width="100%" cellspacing="0"  style="text-align:center;vertical-align:middle;font-size: 16px;">
                        <tr>
                            <td style="text-align:center;vertical-align:middle;">errorKey</td>
                            <td style="text-align:left;vertical-align:middle;" th:text="${taskErrors.errorkey}"/>
                        </tr>
                        <tr>
                            <td style="text-align:center;vertical-align:middle;">errorValue</td>
                            <td style="color: red;text-align:left;vertical-align:middle;" th:text="${taskErrors.errorvalue}"/>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" th:inline="javascript">
    function editpage(id) {
        location.href = "/quartz/edit/taskpage?id=" + id;
    }

    function addNewTask() {
        location.href = "/quartz/add/taskpage/";
    }

    function startOrStop(taskNo) {
        $.ajax({
            url: "/quartz/list/optionjob?taskNo=" + taskNo,
            type: "GET",
            dataType: "json",
            success: function (result) {
                if (result.code == 200) {
                    alert("success!");
                    location.href = "/";
                } else if (result.code == 6001) {
                    alert("任务编号为空!");
                } else if (result.code == 1003) {
                    alert("无此定时任务!");
                } else {
                    alert("system error!");
                }
            }
        });
    };

    function runRightNow(taskNo) {
        $.ajax({
            url: "/quartz/runtask/rightnow?taskno=" + taskNo,
            type: "GET",
            dataType: "json",
            success: function (result) {
                if (result.code == 200) {
                    alert("运行成功!");
                } else if (result.code == 6001) {
                    alert("任务编号不能为空!");
                } else if (result.code == 1003) {
                    alert("无此定时任务!");
                } else {
                    alert("执行失败!");
                }
            }
        });
    }
</script>
</body>
</html>
